{ "cells": [ { "cell_type": "markdown", "id": "e1bb7d3d-9127-4640-a662-71867053b81a", "metadata": {}, "source": [ "# Visualization of Nanostring DSP subtissues" ] }, { "cell_type": "markdown", "id": "e5d9f522-9502-452e-aa7f-a3578e33d017", "metadata": {}, "source": [ "The original data of **Nanostring DSP** technology is different from other technologies, It consists of a number of points to form a ROI, and then the ROI shows the merge expression level. Here we use this tutorial to better visualize the DSP data.\n", "\n", "The more complete week 13 slides were used for presentation. Image data can be downloaded from https://nanostring.com/products/geomx-digital-spatial-profiler/spatial-organ-atlas/mouse-development/." ] }, { "cell_type": "code", "execution_count": 1, "id": "b5ea3ef5", "metadata": {}, "outputs": [], "source": [ "import scanpy as sc\n", "import numpy as np\n", "import pandas as pd\n", "import tifffile as tiff\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "id": "25d4bf9e-b6eb-4377-8f64-1137ef09a4ee", "metadata": {}, "source": [ "### Read" ] }, { "cell_type": "markdown", "id": "3134393f-6415-4871-9592-bb0f19aa03e9", "metadata": {}, "source": [ "Read the Anndata data generated in `Read spatial omics` or `Spatiotemporal pattern` tutorial. " ] }, { "cell_type": "code", "execution_count": 2, "id": "22b1637e-be5e-40bf-aab4-6a8e9fb9cde8", "metadata": {}, "outputs": [], "source": [ "adata = sc.read_h5ad('/csb2/project/SpatialPackage_whq/Tutorial/mouse_embryo_dsp_adata.h5ad')# write Spatiotemporal pattern tutorial's h5ad to make the 'mouse_embryo_dsp_adata.h5ad' data\n", "image = tiff.imread('/csb2/project/tmp_download/GeoMx_MouseDevelopment/image_files/mu_dev_E13_image_files/mu_dev_E13_006.ome.tiff')\n", "image = image[0, :, :]" ] }, { "cell_type": "code", "execution_count": 3, "id": "73074f61-e6ae-49af-9c22-7ba32633534e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['SlideName', 'ScanLabel', 'ROILabel', 'SegmentLabel', 'QCFlags',\n", " 'AOISurfaceArea', 'AOINucleiCount', 'ROICoordinateX', 'ROICoordinateY',\n", " 'RawReads', 'AlignedReads', 'DeduplicatedReads', 'TrimmedReads',\n", " 'StitchedReads', 'SequencingSaturation', 'SequencingSetID', 'UMIQ30',\n", " 'RTSQ30', 'GeoMxNgsPipelineVersion',\n", " 'LOT_Mouse_NGS_Whole_Transcriptome_Atlas_RNA', 'Tissue_annotation',\n", " 'Tissue', 'p63_expression', 'Tissue_substructure', 'Tissue_type',\n", " 'Timepoint', 'ROIID', 'SegmentID', 'ScanWidth', 'ScanHeight',\n", " 'ScanOffsetX', 'ScanOffsetY',\n", " 'LOQ (Mouse NGS Whole Transcriptome Atlas RNA)', 'NormalizationFactor',\n", " 'ExpressionFilteringThreshold (Mouse NGS Whole Transcriptome Atlas RNA)'],\n", " dtype='object')" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "adata.obs.columns" ] }, { "cell_type": "code", "execution_count": 4, "id": "f5c6e1cb-fda2-4695-9171-fe915c3719c4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | slide | \n", "roi | \n", "x | \n", "y | \n", "
|---|---|---|---|---|
| 0 | \n", "mu_dev_E13_006 | \n", "1 | \n", "13011.793535 | \n", "10484.417086 | \n", "
| 1 | \n", "mu_dev_E13_006 | \n", "1 | \n", "13109.708338 | \n", "10499.139178 | \n", "
| 2 | \n", "mu_dev_E13_006 | \n", "1 | \n", "13184.708338 | \n", "10547.123928 | \n", "
| 3 | \n", "mu_dev_E13_006 | \n", "1 | \n", "13242.708338 | \n", "10642.093747 | \n", "
| 4 | \n", "mu_dev_E13_006 | \n", "1 | \n", "13261.840745 | \n", "10730.656697 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 4171 | \n", "mu_dev_E13_011 | \n", "58 | \n", "4548.893838 | \n", "10387.159712 | \n", "
| 4172 | \n", "mu_dev_E13_011 | \n", "58 | \n", "4477.882657 | \n", "10362.799483 | \n", "
| 4173 | \n", "mu_dev_E13_011 | \n", "58 | \n", "4437.660936 | \n", "10371.299021 | \n", "
| 4174 | \n", "mu_dev_E13_011 | \n", "58 | \n", "4487.202775 | \n", "10425.060315 | \n", "
| 4175 | \n", "mu_dev_E13_011 | \n", "58 | \n", "4636.188087 | \n", "10423.920083 | \n", "
4176 rows × 4 columns
\n", "